/**
 * DomWon
 * Created with Intellij IDEA.
 * Description:
 * User:WEI
 * Date:2023/3/11
 * Time:8:11
 */
public class TestDemo {
    public static void main1(String[] args) {
        int[] array = {5,8,9,5,4,23,27,66};
        boolean ret = func2(array);
        System.out.println(ret);
    }

    public static boolean func2(int[] array) {
        for (int i = 0; i < array.length-2; i++) {
            if(array[i]%2 != 0) {
                if(array[i+1]%2 != 0) {
                    if(array[i+2]%2 != 0) {
                        return true;
                    }
                }
            }
        }
        return false;
    }
    
    public static void main(String[] args) {
        int[] array = {4,2,1,2,2,2,3,7,2,1};
        int ret = func1(array);
        System.out.println(ret);
    }
    
    public static int func1 (int[] array) {
        int i = 0;
        first : for (i = 0; i < array.length; i++) {
            int count = 0;
            for (int j = 0; j < array.length; j++) {
                if(array[j] == array[i]) {
                    count++;
                } else {
                    count--;
                }
            }
            if(count >= 0) {
                break first;
            }
        }
        return array[i];
    }
}
